<template name="zradio">
	<view class="radio-view">
		<!-- <text class="question">{{que}}<text class="tip" v-if="!empty">*</text></text> -->
		<view class="uni-list theme-input" style="width:99%;">
            <radio-group @change="rc">
                <label class="uni-list-cell uni-list-cell-pd" v-for="item in choices" :key="item">
                    <view class="row-arrange">
                        <radio :value="item" color="green" style="margin-top:10upx;"/>
						<text class="normal-font-size">{{item}}</text>
                    </view>
                </label>
            </radio-group>
        </view>
		<text class="tip" v-if="errorText.length>0">{{errorText}}</text>
	</view>
</template>

<script>
	export default {
		name : "zradio",
		data() {
			return {
				value : "",
				errorText : ""
			};
		},
		props : {
			compType : {
				type : String,
				default : "zradio"
			},
			choices : {
				type : Array,
				// value : true，
				default : true
			},
			empty : {
				type : Boolean,
				default : false
			},
			que : {
				type : String,
				default : "问题"
			}
		},
		methods: {
			
			get : function(){
				if(this.empty == false && this.value.length == 0){
					this.errorText = "内容不可为空";
					return null;
				}else{
					this.errorText = "";
				}
				return this.value;
			},
			rc : function(evt) {
				this.value = evt.target.value;
			}
		}
	}
</script>

<style>
	@import "../../../common/zcss.css";
	.radio-view{
		flex-direction: column;
	}
	.question{
		display: inline;
		font-size: 15upx;
	}
	/* #answer-view{
		flex-direction: row;
	} */
	.tip{
		padding-top: 5upx;
		margin-left: 5upx;
		color: red;
		font-size: 30upx;
	}
</style>
